{% extends 'layout.html' %}

{% block scripts %}
<script src="/js/admin/forum.js"></script>
{% endblock %}

{% block content %}
<h2>已建立的討論區</h2>
<button id="create-button">新增討論區</button>
<table id="forum-table" border="0" width="700" cellspacing="5" cellpadding="5">
  <thead>
    <tr>
      <th width="50">&nbsp;</th>
      <th>討論區標題</th>
      <th width="150">建立時間</th>
      <th width="200">&nbsp;</th>
    </tr>
  </thead>
  <tbody>
  {% for f in forums %}<tr>
    <td><input type="checkbox"></td>
    <td>{{ f.title }}</td>
    <td>{{ f.created|date:"Y-m-d H:i:s" }}</td>
  </tr>{% endfor %}
  </tbody>
</table>

<div class="hide" id="forum-dialog" class="dialog">
  <form method="post" action="#" id="forum-form">
    <fieldset>
      <dl>
        <dt><label class="label" for="forum-title">標題</label></dt>
        <dd><input type="text" name="forum[title]" id="forum-title" size="40"></dd>
        <dt><label class="label" for="forum-desc">敘述</label></dt>
        <dd><textarea id="forum-desc" name="forum[desc]" rows="5" cols="40"></textarea></dd>
        <dt><label class="label" for="forum-permalink">連結</label></dt>
        <dd><input type="text" name="forum[permalink]" id="forum-permalink" size="40"></dd>
        <dt><label class="label" for="forum-category">分類</label></dt>
        <dd>
          <select id="forum-category" name="forum[category]">
            <option>General</option>
            <option>Open API</option>
            <option>Platform</option>
            <option>Application</option>
          </select>
        </dd>
      </dl>
    </fieldset>
  </form>
</div>
{% endblock %}
